package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.Address;
import com.example.demo.entity.Commdity;
import com.example.demo.entity.Order;
import com.example.demo.entity.Shop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ShopMapper extends BaseMapper<Shop> {
    @Select("SELECT id,shopname,shopmessage,shopimage,shoplatitude,shoplongitude,shopplace FROM shop")
    List<Shop> allshop();

    @Select("SELECT shopname FROM " +
            "order1,shop where order1.shopid=shop.id and order1.state=#{state}")
    List<Shop>findBy_stateid(int state);


}
